#include "T_AttribAssociateScn.h"

T_AttribAssociateScn::T_AttribAssociateScn()
{
	m_pImage = NULL;
}

T_AttribAssociateScn::~T_AttribAssociateScn()
{
}

bool T_AttribAssociateScn::OnInit(GAF_CBundle* pParam)
{
	m_pImage = GAF_CImage::Create("./res/Image.jpg");
//  	m_pImage->SetZoomXWidth(100);
  	m_pImage->Associate(
		GAF_CGraphics::ATTRIB_LOCAX,
		GAF::Interval(GAF_pTHEWINDOW->GetSize_a().nWidth, GAF_pTHEWINDOW->GetSize_a().nWidth >> 1),
		GAF_CGraphics::ATTRIB_ZOOM,
		GAF::Interval(0.5, 0.25));
 	m_pImage->Associate(
		GAF_CGraphics::ATTRIB_LOCAX,
		GAF::Interval(GAF_pTHEWINDOW->GetSize_a().nWidth >> 1, 0),
		GAF_CGraphics::ATTRIB_ZOOM,
		GAF::Interval(0.25, 0.5));
	m_pImage->SetLocation(0, 380);
 	m_pImage->SetGraphicsName("Window");
 	m_pImage->SetAnchor_a(GAF_ANCHOR_VCENTER | GAF_ANCHOR_HCENTER);
	AddGraphics(m_pImage);

	GAF_SMoveIntent _intent;
	static GAF_SPoint _atPathTo = {GAF_pTHEWINDOW->GetSize_a().nWidth, 380};
	_intent.nPathNum = 1;
	_intent.atPaths = &_atPathTo;
	_intent.amMode = GAF_ACTION_AGAIN;
	_intent.nTimes = 100;
	m_maImage.SetHostGraphics_a(m_pImage);	m_maImage.SetIntent(&_intent);
	m_maImage.SetSpeed_a(500);	m_maImage.Play();

	return true;
}

void T_AttribAssociateScn::OnKeyUp(ULONG lCode)
{
	ReturnOK();
}
